import request from '@/utils/request'

export function getTagPagedList(query) {
  return request({
    url: `/api/business/tags_admin/`,
    method: 'get',
    params: query
  })
}
export function getTagForEdit(id) {
  return request({
    url: `/api/business/tags_admin/${id}`,
    method: 'get'
  })
}

export function createTag(data) {
  return request({
    url: `/api/business/tags_admin/`,
    method: 'post',
    data
  })
}

export function updateTag(id, data) {
  return request({
    url: `/api/business/tags_admin/${id}/`,
    method: 'put',
    data
  })
}

export function deleteTag(id) {
  return request({
    url: `/api/business/tags_admin/${id}/`,
    method: 'delete'
  })
}

export function getTopTagsForSelector(query) {
  return request({
    url: `/api/business/tags/selector/`,
    method: 'get',
    params: query
  })
}
